#include <stdio.h>
#include <malloc.h>

const unsigned SET1[32] = {0x1,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x100,0x200,0x400,0x800,0x1000,0x2000,0x4000,0x8000,0x10000,0x20000,0x40000,0x80000,0x100000,0x200000,0x400000,0x800000,0x1000000,0x2000000,0x4000000,0x8000000,0x10000000,0x20000000,0x40000000,0x80000000};

unsigned Str2Float(char* str);
void Float2Binary(unsigned f);
unsigned Plus(unsigned f1, unsigned f2);
unsigned Minus(unsigned f1, unsigned f2);
unsigned Multiply(unsigned f1, unsigned f2);
unsigned Divide(unsigned f1, unsigned f2);

int main() {
    char cmd[100];
    while(scanf("%s",cmd) != EOF) {
        int idx = 0;
        while('0' <= cmd[idx] && cmd[idx] <= '9' || cmd[idx] == '.')
            ++idx;
        char op = cmd[idx];
        if(op == '\0') {
            Float2Binary(Str2Float(cmd));
        } else {
            cmd[idx] = '\0';
            unsigned f1 = Str2Float(cmd);
            unsigned f2 = Str2Float(cmd+idx+1);
            unsigned result;
            switch(op) {
                case '+':
                result = Plus(f1,f2);
                break;
                case '-':
                result = Minus(f1,f2);
                break;
                case '*':
                result = Multiply(f1,f2);
                break;
                case '/':
                result = Divide(f1,f2);
                break;
            }
            Float2Binary(result);
        }
    }
    return 0;
}

unsigned Str2Int(char* str) { //字符串转整数
    unsigned ret = 0;
    for(int i = 0; str[i] != '\0'; ++i) {
        ret *= 10;
        ret += str[i] - '0';
    }
    return ret;
}

unsigned Int2Significand(unsigned num_f) { //num_f是被视为整数的小数部分，要转成尾数，这里使用乘2取整法
    unsigned mod = 10;
    for(int i = 0; mod <= num_f; ++i)
        mod *= 10;
    unsigned ret = 0;
    for(int i = 22; i >= 0; i--) {
        num_f <<= 1;
        if(num_f >= mod) {
            num_f -= mod;
            ret |= SET1[i];
        }
    }
    return ret;
}

int Formulating(unsigned * f) { //格式化浮点数，并返回阶数的变化值
    if(*f == 0)
        return 0x8fffffff;
    int delta_exp = 0;
    while(*f >= SET1[24]) {
        *f >>= 1;
        delta_exp++;
    }
    while(*f < SET1[23]) {
        *f <<= 1;
        delta_exp--;
    }
    *f &= ~SET1[23]; //隐藏位技术
    return delta_exp;
}

unsigned Str2Float(char* str) {
    unsigned sign;
    switch(str[0]) {
        case '-':
        sign = SET1[31];
        str++;
        break;
        case '+':
        sign = 0;
        str++;
        break;
        default:
        sign = 0;
        break;
    }
    int len_i = 0;
    while(str[len_i] != '\0' && str[len_i] != '.')
        ++len_i;
    unsigned num_i;
    unsigned num_f;
    if(str[len_i] == '\0') {
        num_i = Str2Int(str);
        num_f = 0;
    } else {
        str[len_i] = '\0';
        num_i = Str2Int(str);
        num_f = Str2Int(str+len_i+1);
    }
    unsigned significand = Int2Significand(num_f);
    significand = (num_i << 23) | significand;
    int delta_exp = Formulating(&significand);
    unsigned exp = (delta_exp + 127); //原码转移码
    if(delta_exp == 0x8fffffff)
        return 0;
    else
        return sign | (exp << 23) | significand;
}

void Float2Binary(unsigned f) {
    char str[40];
    for(int i = 31, idx_str = 0; i >= 0; --i) {
        if((f & SET1[i]) != 0)
            str[idx_str] = '1';
        else
            str[idx_str] = '0';
        idx_str++;
        if(i % 4 == 0) {
            str[idx_str] = ' ';
            idx_str++;
        }
    }
    str[39] = '\0';
    printf(" = %s\n",str);
}

unsigned GetExp(unsigned f) { //最高位置0，右移23位，得到指数位
    unsigned exp = (f & ~SET1[31]) >> 23;
    return exp;
}

unsigned GetSignificant(unsigned f) { //31到24位置0，23位置1，得到尾数位
    f &= 0x00ffffff;
    f |= SET1[23];
    return f;
}

unsigned Plus(unsigned f1, unsigned f2) {
    unsigned sign1 = f1&SET1[31];
    unsigned sign2 = f2&SET1[31];
    unsigned exp1 = GetExp(f1);
    unsigned exp2 = GetExp(f2);
    unsigned s1 = GetSignificant(f1);
    unsigned s2 = GetSignificant(f2);
    while(exp1 > exp2) { //对阶
        s2 >>= 1;
        exp2++;
    }
    while(exp1 < exp2) {
        s1 >>= 1;
        exp1++;
    }
    if(sign1 != 0) //尾数相加
        s1 = ~s1 + 1;
    if(sign2 != 0)
        s2 = ~s2 + 1;
    unsigned s = s1 + s2;
    unsigned sign = s & SET1[31];
    if(sign != 0)
        s = ~s + 1;
    int delta_exp = Formulating(&s); //规格化
    unsigned exp = exp1 + delta_exp;
    if(delta_exp == 0x8fffffff)
        return 0;
    else
        return sign | (exp << 23) | s;
}

unsigned Minus(unsigned f1, unsigned f2) {
    f2 ^= SET1[31]; //f2的符号位取反
    return Plus(f1,f2);
}

unsigned Multiply(unsigned f1, unsigned f2) {
    unsigned sign1 = f1&SET1[31];
    unsigned sign2 = f2&SET1[31];
    unsigned exp1 = GetExp(f1);
    unsigned exp2 = GetExp(f2);
    unsigned long long s1 = GetSignificant(f1);
    unsigned long long s2 = GetSignificant(f2);
    unsigned sign = sign1 ^ sign2;
    unsigned exp = exp1 + exp2 - 127; //指数相加要减去一个偏阶
    unsigned s = (s1 * s2) >> 23; //尾数相乘要注意浮点的位置
    int delta_exp = Formulating(&s); //规格化
    exp += delta_exp;
    if(delta_exp == 0x8fffffff)
        return 0;
    else
        return sign | (exp << 23) | s;
}

unsigned Divide(unsigned f1,unsigned f2) {
    if(f2 == 0)
        return 0xffffffff;
    unsigned sign1 = f1&SET1[31];
    unsigned sign2 = f2&SET1[31];
    unsigned exp1 = GetExp(f1);
    unsigned exp2 = GetExp(f2);
    unsigned long long s1 = GetSignificant(f1);
    unsigned long long s2 = GetSignificant(f2);
    unsigned sign = sign1 ^ sign2;
    unsigned exp = exp1 - exp2 + 127; //指数相减要加回一个偏阶
    unsigned s = (s1 << 23)/ s2; //尾数相除也要注意浮点的位置
    int delta_exp = Formulating(&s); //规格化
    exp += delta_exp;
    if(delta_exp == 0x8fffffff)
        return 0;
    else
        return sign | (exp << 23) | s;
}